<?php

/**
 * ContactForm class.
 * ContactForm is the data structure for keeping
 * contact form data. It is used by the 'contact' action of 'SiteController'.
 */
class ContactForm extends CFormModel
{
	public $name;
    public $address;
	public $email;
    public $phone;
    public $fax;
	public $content;

	/**
	 * Declares the validation rules.
	 */
	public function rules()
	{
		return array(
			// name, email, subject and body are required
            array('name','required','message' => Yii::t('site/general','Please input your name')),
            array('email','required','message' => Yii::t('site/general','Please input your email')),
            array('email','email','message' => Yii::t('site/general','Your email is not valid')),
            array('content','required','message' => Yii::t('site/general','Please input content')),
		);
	}

	/**
	 * Declares customized attribute labels.
	 * If not declared here, an attribute would have a label that is
	 * the same as its name with the first letter in upper case.
	 */
	public function attributeLabels()
	{
		return array(
			'name'=>Yii::t('site/general','Name'),
            'address'=>Yii::t('site/general','Address'),
            'phone'=>Yii::t('site/general','Phone'),
            'fax'=>Yii::t('site/general','Fax'),
            'email'=>Yii::t('site/general','Email'),
            'content'=>Yii::t('site/general','Content'),
		);
	}
}